Skip to content

test(e2e): characterize executor run-to-completion behavior#540

Open
MGudgin wants to merge 1 commit into
mainfrom
user/gudge/executor-characterization-tests
Open

test(e2e): characterize executor run-to-completion behavior#540
MGudgin wants to merge 1 commit into
mainfrom
user/gudge/executor-characterization-tests

Conversation

@MGudgin

@MGudgin MGudgin commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds cross-platform executor characterization tests that lock in the current run-to-completion behavior of the native one-shot executors (mxc-exec-mac / lxc-exec / wxc-exec.exe) and wires them into CI, so the upcoming unified SandboxBackend/Runner refactor can't silently change existing dev/user flows.

Details

  • New characterization suites in wxc_e2e_tests: Seatbelt (macOS) and Bubblewrap (Linux) cover exit code, stdout, env and working-directory handling, and timeout; ProcessContainer (Windows) covers exit code/stdout/timeout and is opt-in via MXC_E2E_HOST_PREPPED=1. New harness helpers locate/run the native executor with per-run env/cwd, gate on bwrap, and fix macOS target-triple discovery.
  • CI wiring: the macOS job now builds/tests -p wxc_e2e_tests; the Linux job installs bubblewrap (and relaxes the Ubuntu 24.04 unprivileged user-namespace AppArmor clamp) and runs the suite. wxc_e2e_tests previously ran on neither platform.
  • The Seatbelt env-inheritance (empty process.env) and launcher-cwd (empty process.cwd) tests are deliberate regression guards: the refactor's always-clear-env / always-rewrite-cwd behavior will turn them red.
  • Not covered: stdin/TTY (the run-to-completion harness closes stdin, so the SIGTTIN regression needs a PTY harness) and Windows ProcessContainer on CI (needs a host-prepped lane). Both are follow-ups.

Tests

  • CI green on macOS, Linux, and Windows: the macOS and Linux cargo-test jobs now execute and pass the new suites; clippy (-D warnings) and rustfmt --check are clean on aarch64-apple-darwin and x86_64-unknown-linux-gnu.
  • First CI execution empirically confirmed the Bubblewrap run-to-completion tree-kill gap (a forked process survives the timeout) and that Seatbelt tree-kills correctly; assertions were tuned to current behavior accordingly.

Copilot AI review requested due to automatic review settings June 19, 2026 17:38
@MGudgin

MGudgin commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds cross-platform executor characterization E2E tests in wxc_e2e_tests to lock in the current “run-to-completion” behavior of the native one-shot executors (mxc-exec-mac, lxc-exec, wxc-exec.exe) ahead of the upcoming unified SandboxBackend/Runner refactor. This strengthens CI as a regression signal by turning previously-observed behavioral drift (notably on Seatbelt env/cwd inheritance) into explicit, testable contracts.

Changes:

  • Add Seatbelt (macOS) executor characterization tests for exit code, stdout, env/cwd inheritance, explicit env/cwd, and timeout behavior.
  • Add Bubblewrap (Linux) executor characterization tests (gated on bwrap presence) for exit code, stdout, default env clearing, explicit env/cwd, and timeout behavior.
  • Add ProcessContainer (Windows) executor characterization tests gated on MXC_E2E_HOST_PREPPED=1, plus shared helpers to locate/run the native executor and fix macOS target triple resolution.
Show a summary per file
File Description
src/testing/wxc_e2e_tests/tests/e2e_seatbelt_characterization.rs Adds macOS Seatbelt run-to-completion characterization tests (including env/cwd inheritance guards).
src/testing/wxc_e2e_tests/tests/e2e_bubblewrap_characterization.rs Adds Linux Bubblewrap run-to-completion characterization tests, gated on bwrap availability.
src/testing/wxc_e2e_tests/tests/e2e_processcontainer_characterization.rs Adds Windows ProcessContainer characterization tests gated on MXC_E2E_HOST_PREPPED=1 and host prerequisites.
src/testing/wxc_e2e_tests/src/lib.rs Adds cross-platform executor helpers (has_platform_exec, run_platform_config_value, etc.) and macOS target triple support for binary discovery.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Comment thread src/testing/wxc_e2e_tests/tests/e2e_bubblewrap_characterization.rs Outdated
@MGudgin MGudgin force-pushed the user/gudge/executor-characterization-tests branch from 89d6de2 to 8158870 Compare June 19, 2026 18:46
@MGudgin

MGudgin commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

This PR adds cross-platform executor characterization tests that lock in
the current run-to-completion behavior of the native one-shot executors
(mxc-exec-mac / lxc-exec / wxc-exec.exe) and wires them into CI, so the
upcoming unified SandboxBackend/Runner refactor can't silently change
existing dev/user flows.

Details

* New characterization suites in wxc_e2e_tests: Seatbelt (macOS) and
  Bubblewrap (Linux) cover exit code, stdout, env and working-directory
  handling, and timeout; ProcessContainer (Windows) covers exit
  code/stdout/timeout and is opt-in via MXC_E2E_HOST_PREPPED=1. New
  harness helpers locate/run the native executor with per-run env/cwd,
  gate on bwrap, and fix macOS target-triple discovery.
* CI wiring: the macOS job now builds/tests -p wxc_e2e_tests; the Linux
  job installs bubblewrap (and relaxes the Ubuntu 24.04 unprivileged
  user-namespace AppArmor clamp) and runs the suite. wxc_e2e_tests
  previously ran on neither platform.
* The Seatbelt env-inheritance (empty process.env) and launcher-cwd
  (empty process.cwd) tests are deliberate regression guards: the
  refactor's always-clear-env / always-rewrite-cwd behavior will turn
  them red.
* Not covered: stdin/TTY (the run-to-completion harness closes stdin, so
  the SIGTTIN regression needs a PTY harness) and Windows ProcessContainer
  on CI (needs a host-prepped lane). Both are follow-ups.

Tests

* CI green on macOS, Linux, and Windows: the macOS and Linux cargo-test
  jobs now execute and pass the new suites; clippy (-D warnings) and
  rustfmt --check are clean on aarch64-apple-darwin and
  x86_64-unknown-linux-gnu.
* First CI execution empirically confirmed the Bubblewrap
  run-to-completion tree-kill gap (a forked process survives the timeout)
  and that Seatbelt tree-kills correctly; assertions were tuned to current
  behavior accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MGudgin MGudgin force-pushed the user/gudge/executor-characterization-tests branch from 90fe32e to 123d8db Compare June 19, 2026 19:53
@MGudgin MGudgin marked this pull request as ready for review June 19, 2026 20:02
@MGudgin MGudgin requested a review from a team as a code owner June 19, 2026 20:02
@MGudgin MGudgin changed the title test(e2e): characterize current executor run-to-completion behavior test(e2e): characterize executor run-to-completion behavior Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants